﻿/******************************************************************
 *Company: http://www.xiaomutech.com/
 *fileName : alarmclock.h --- AlarmClock
 *Auth       : yhni (QQ:393320854)
 *Create    : 2022/2/9
 *Description   :
 *Histroy:
 *<Auth>    <Date>        <Ver>        <Content>
 *         2022/2/9
 *******************************************************************/
#ifndef ALARMCLOCK_H
#define ALARMCLOCK_H

#include <QWidget>
#include <QTimer>

class AlarmClock : public QWidget
{
    Q_OBJECT
public:
    explicit AlarmClock(QWidget *parent = nullptr);
    ~AlarmClock();

    void start(int count = 30);
    void stop();

signals:
    void timeout();

private slots:
    void sltTimeTick();

private:
    int      m_timeTick;
    QTimer  *m_timer;

protected:
    QSize sizeHint() const override;
    void paintEvent(QPaintEvent *) override;
};

#endif // ALARMCLOCK_H
